<{include file=$module.'/header.php'}>
<div class="page order-info">
	<header class="bar bar-nav common-bar-nav ">
		<a class="pull-left back"><i class="fa fa-arrow-left"></i></a>
		<h1 class="title">订单详情</h1>
		<a href="javascript:;" onclick="location.reload();" class="pull-right">刷新</a>
	</header>
	<{include file=$module.'/nav.php'}>
	<div class="content">
		<div class="buttons-tab">
			<a href="#order-detail" class="tab-link active button">订单详情</a>
			<a href="#order-status" class="tab-link button">订单进度</a>
			<{if $info.device_id}>
			<a href="#device-detail" class="tab-link button">设备信息</a>
			<a href="#device-status" class="tab-link button">历史记录</a>
			<{/if}>
		</div>
		<div class="tabs">
			<div id="order-detail" class="tab active">

				<{if $info.photos}>
				<div class="content-block-title">图片</div>
				<div class="image-container muti-upload">
					<ul id="upload-list" class="upload-list p-b-0">
						<{foreach $info.photos as $val}>
						<li><img src="<{$setting.oss.oss_domain}><{$val}>"></li>
						<{/foreach}>
					</ul>
				</div>
				<{/if}>
				<{if $info.voice}>
				<div class="content-block-title">音频</div>
				<div class="list-block m-b-0  other-info">
					<ul>
						<li class="item-content">
							<div class="item-inner">
								<div class="item-title">录音</div>
								<div class="item-after"><audio loop autoplay="autoplay" controls id="bgMusic"  src="<{$setting.oss.oss_domain}><{$info.voice}>"></audio></div>
							</div>
						</li>
					</ul>
				</div>
				<{/if}>
				<div class="content-block-title">详情</div>
				<div class="list-block m-b-0  other-info">
					<ul>
						<li class="item-content">
							<div class="item-inner">
								<div class="item-title">编号</div>
								<div class="item-after"><{$info.id}></div>
							</div>
						</li>
						<li class="item-content">
							<div class="item-inner">
								<div class="item-title">状态</div>
								<div class="item-after"><span class="color-danger"><{$orderStatus[$info.order_status]}></span></div>
							</div>
						</li>
					</ul>
				</div>


				<div class="content-block-title">报修</div>
				<div class="list-block m-b-0  other-info">
					<ul>
						<li class="item-content">
							<div class="item-inner">
								<div class="item-title">标题</div>
								<div class="item-after"><{$info.title}></div>
							</div>
						</li>
						<li class="item-content">
							<div class="item-inner">
								<div class="item-title">位置</div>
								<div class="item-after"><{$info.local}></div>
							</div>
						</li>
					</ul>
				</div>
				
				<div class="content-block-title">人员</div>
				<div class="list-block m-b-0  other-info">
					<ul>
						<li class="item-content">
							<div class="item-inner">
								<div class="item-title">报修员</div>
								<div class="item-after"><{$admin.realname}> <a class="item-after external" href="tel:<{$admin.tel}>"><span class="color-danger"><{$admin.tel}></span></a></div>
							</div>
						</li>
						<li class="item-content">
							<div class="item-inner">
								<div class="item-title">师傅</div>
								<div class="item-after"><{$shifu.realname}> <a class="item-after external" href="tel:<{$shifu.tel}>"><span class="color-danger"><{$shifu.tel}></span></a></div>
							</div>
						</li>
					</ul>
				</div>
				
				
				<div class="content-block-title">描述</div>
				<div class="list-block m-b-0 other-info">
					<ul>
						<li class="align-top">
							<div class="item-content">
								<div class="item-inner">
									<div class="item-input">
										<textarea name="intro" readonly><{$info.intro}></textarea>
									</div>
								</div>
							</div>
						</li>
					</ul>
				</div>
				
				
			</div>
			<div id="order-status" class="tab">
				<{foreach $info.logs as $key => $val}>
				<div class="order-status-item">
					<div class="guide">
						<{if $info.logs_maxid != $key}>
							<img src="/static/app/img/order_status_service_grey.png" alt="" />
						<{else}>
							<img src="/static/app/img/order_status_service.png" alt="" />
						<{/if}>
					</div>
					<div class="order-status-info">
						<div class="arrow-left"></div>
						<div class="clearfix"><{$val.intro.msg}> <span class="time pull-right"><{$val.add_time}></span></div>
						<div class="tips"><{$val.intro.intro}></div>
						<{if $val.order_status==5}>
						<!-- <div class="tips">佣金：<{$val.msg.yj_money}></div> -->
						<{/if}>

						<{if $val.intro.photos}>
						<div class="image-container muti-upload">
							<ul id="upload-list" class="upload-list p-b-0">
								<{foreach $val.intro.photos as $v}>
								<li><img src="<{$setting.oss.oss_domain}><{$v}>"></li>
								<{/foreach}>
							</ul>
						</div>
						<{/if}>
						
					</div>
				</div>
				<{/foreach}>
			</div>



			<{if $info.device_id}>
			<!-- 设备信息 -->
			<div id="device-detail" class="tab">
				<{if $device}>
				<div class="list-block">
					<ul>
						<li>
							<a class="item-link item-content">
								<div class="item-inner">
									<div class="item-title label">设备名称</div>
									<div class="item-after">
										<span id="local-device"><{$device.name}></span>
										<input id="data-device" type="hidden" name="data[device_id]" value="<{$device.id}>"/>
									</div>
								</div>
							</a>
						</li>
						<li>
							<a class="item-link item-content">
								<div class="item-inner">
									<div class="item-title label">设备编码</div>
									<div class="item-after">
										<span><{$device.config.bianma}></span>
									</div>
								</div>
							</a>
						</li>
						<li>
							<a class="item-link item-content">
								<div class="item-inner">
									<div class="item-title label">设备型号</div>
									<div class="item-after">
										<span><{$device.config.xinghao}></span>
									</div>
								</div>
							</a>
						</li>
						<li>
							<a class="item-link item-content">
								<div class="item-inner">
									<div class="item-title label">生产日期</div>
									<div class="item-after">
										<span><{$device.config.riqi}></span>
									</div>
								</div>
							</a>
						</li>
						<li>
							<a class="item-link item-content">
								<div class="item-inner">
									<div class="item-title label">设备厂家</div>
									<div class="item-after">
										<span><{$device.config.changjia}></span>
									</div>
								</div>
							</a>
						</li>
					</ul>
				</div>
				<{/if}>
			</div>
			<!-- 历史记录 -->
			<div id="device-status" class="tab">
			<{if $device.logs}>
				<{foreach $device.logs as $key => $val}>
				<div class="order-status-item">
					<div class="guide">
						<{if $device.logs_maxid != $key}>
							<img src="/static/app/img/order_status_service_grey.png" alt="" />
						<{else}>
							<img src="/static/app/img/order_status_service.png" alt="" />
						<{/if}>
					</div>
					<div class="order-status-info">
						<div class="arrow-left"></div>
						<div class="clearfix"><{$val.intro.msg}> <span class="time pull-right"><{$val.add_time}></span></div>
						<div class="tips"><{$val.intro.intro}></div>
						

						<{if $val.intro.photos}>
						<div class="image-container muti-upload">
							<ul id="upload-list" class="upload-list p-b-0">
								<{foreach $val.intro.photos as $v}>
								<li><img src="<{$setting.oss.oss_domain}><{$v}>"></li>
								<{/foreach}>
							</ul>
						</div>
						<{/if}>
						
					</div>
				</div>
				<{/foreach}>
			<{/if}>
			</div>
			<{/if}>

		</div>
		<div class="ui-footspace"></div>
	</div>
</div>

<script>
$(function(){
	<{if $info.photos}>
	/*=== 默认为 standalone ===*/
	var myPhotoBrowserStandalone = $.photoBrowser({
	  photos : [
	  		<{foreach $info.photos as $val}>
	  		'<{$setting.oss.oss_domain}><{$val}>',
	  		<{/foreach}>
	  		<{foreach $logs as $key => $val}>
	  		<{if $val.intro.photos}>
	  		<{foreach $val.intro.photos as $v}>
			'<{$setting.oss.oss_domain}><{$v}>',
			<{/foreach}>
	  		<{/if}>
	  		<{/foreach}>
	  ]
	});


	$(document).on('click','.image-container img', function(e){ 
		myPhotoBrowserStandalone.open();
	});
	<{/if}>


	$.init();

	
});
</script>
<{include file=$module.'/footer.html'}>